package com.srd.phone.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.shengrongdai.srd.R;
import com.srd.phone.bean.TenderInfo;
import com.srd.phone.utils.views.ViewHolder;

import java.util.ArrayList;
import java.util.List;

public class TransferManageAdapter extends BaseAdapter {

    private Context context;
    private List<TenderInfo> list = new ArrayList<TenderInfo>(10);

    public TransferManageAdapter(Context context) {
        this.context = context;
    }

    public void setData(List<TenderInfo> list0) {
        list = list0;
        notifyDataSetChanged();
    }

    @Override
    public int getCount() {
        return 10;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View view, ViewGroup parent) {
        ViewHolder viewHolder =  ViewHolder.get(context, view, parent, R.layout.item_transfer_manage, position);

        LinearLayout ll_layout = viewHolder.getView(R.id.ll_layout);
        TextView tv_transfer_state = viewHolder.getView(R.id.tv_state);
        tv_transfer_state.setTextColor(Color.parseColor("#80C985"));
        tv_transfer_state.setBackgroundResource(R.drawable.shape_transfer_succeed);

        if(position % 2 == 0)
            ll_layout.setBackgroundColor(Color.WHITE);
        else
            ll_layout.setBackgroundColor(Color.parseColor("#F7F7F7"));

        return viewHolder.getConvertView();
    }


}
